﻿using Common.Data.Extensions;
using ModernChannel.Configuration;
using ModernChannel.Model.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ModernChannel.Data.DBConfig
{
    public class SerialNumberRdcHistConfiguration : DBConfig<SerialNumberRdcHist>
    {
        public SerialNumberRdcHistConfiguration()
            : base(SystemConfiguration.Schema, SystemConfiguration.NamingType, SystemConfiguration.TABLE_PREFIX)
        {
            HasKey(k => new { k.Model, k.Suffix, k.SerialNo });
            Property(c => c.IncentiveFlag).HasMaxLength(1).IsRequired();
            Property(c => c.SelloutStatus).HasMaxLength(1).IsRequired();
            Property(c => c.CreateDate).IsRequired();
            Property(c => c.SerialNo).HasMaxLength(100).IsRequired();
            Property(c => c.Suffix).HasMaxLength(20).IsRequired();
            Property(c => c.InvOrg).HasMaxLength(5).IsRequired();
            Property(c => c.EdiNo).HasMaxLength(16).IsRequired();
            Property(c => c.Model).HasMaxLength(20).IsRequired();
            Property(c => c.ModelSuffix).HasMaxLength(20).IsRequired();
        }
    }
}
